<style>.footer.footer-home {display: none;}</style>
<div id="my-order-page">
<div class="header">
    <a href="index.php?act=member" class="return iconfont icon-shangyiye"></a>
    <div class="header-title">我的订单</div>
</div>
<div class="header header-categoryson">
    <form action="index.php" method="get" id="cfrom">
        <input type="hidden" name="act" value="merchant">
        <input type="hidden" name="op" value="consume">
        <div class="search-box">
            <i class="iconfont icon-sousuo"></i>
            <input type="text" name="code" value="<?php echo $output['code']; ?>" placeholder="请输入券码" />
        </div>
    </form>
</div>
<div class="order-list">
    <ul>
        <?php if (!empty($output['order'])): ?>
        <?php if ($output['order']): ?>
        <li>
            <a href="index.php?act=merchant&op=actdetail&ordersn=<?php echo $output['order']['bg_order_sn']; ?>">
            <div class="list-mid">
                <div class="list-img">
                    <img src="<?php echo $output['order']['bg_thumb']; ?>" />
                </div>
                <div class="list-info">
                    <p class="title"><?php echo $output['order']['bg_title']; ?></p>
                    <div><span>¥</span><?php echo $output['order']['bg_order_price']; ?><span> / 张</span> <span class="fr">×1</span></div>
                    <p class="code">取票码:<?php echo $output['order']['bg_order_code'] ? substr($output['order']['bg_order_code'],0,10).str_repeat('x',6) : ''; ?></p>
                </div>
            </div>
            </a>

            <div class="list-bot">
                <samp>合计：</samp><span>¥<?php echo $output['order']['bg_order_price']; ?></span>
                <a href="javascript:consume('<?php echo $output['order']['bg_order_sn']; ?>');" class="btn1 fr">确认核销</a>
            </div>
        </li>
        <?php endif; ?>
        <?php else: ?>
            <div class="empty">暂无内容</div>
        <?php endif; ?>
    </ul>
</div>
</div>

<ul class="verify-btn">
    <li class="border0">
        <input type="submit" value="确认" form="cfrom" class="btn-green" />
    </li>
</ul>

<script>
    function consume(order_sn) {
        popConfirm('请确认是否核销该订单', function () {
            $.post('index.php?act=merchant&op=doconsume&type=act', {order_sn:order_sn}, function (data) {
                if (data.errcode == 0) {
                    popAlert(data.errmsg, function () {
                        location.reload();
                    });
                } else {
                    popAlert(data.errmsg);
                }
            }, 'json');
        });
    }
</script>